<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>判断时间段</title>
</head>
<body>
    <script>
        var num=prompt("您输入的数字是(0-23之间):");
        if(6<=num<=12){
            alert("上午好");
        }else if(13<=num&&num<=18){
            alert("中午好");
        }else if(19<=num&&num<=23){
            alert("晚上好");
        }else if(0<=num&&num<=5){
            alert("这是休息时间，不要说话");
        }
    </script>
</body>
</html>